package com.totem.base.enums;

import lombok.Getter;

@Getter
public enum JournalTypeEnum {
    RECHARGE("RECHARGE", "充值"),
    WITHDRAW("WITHDRAW", "提现"),
    GOODS_ORDER("GOODS_ORDER", "购买商品"),
    FUND_ORDER("FUND_ORDER", "投入基金"),
    FUND_WITHDRAW("FUND_WITHDRAW", "基金提取"),
    SUBSCRIBE_ORDER("SUBSCRIBE_ORDER", "认购套餐"),
    FUND_RETURN("FUND_RETURN", "基金收益"),
    SUBSCRIBE_RETURN("SUBSCRIBE_RETURN", "认购收益"),
    SUBSCRIBE_AWARD("SUBSCRIBE_AWARD", "认购奖励"),
    INVITE_AWARD("INVITE_AWARD", "推荐奖励"),
    TEAM_AWARD("TEAM_AWARD", "团队激励"),
    BAL_CONVERSION("BAL_CONVERSION", "余额转化"),
    ADMIN_OPERATE("ADMIN_OPERATE", "管理员操作");

    private final String code;
    private final String cn;

    JournalTypeEnum(String code, String cn){
        this.code = code;
        this.cn = cn;
    }

    public static JournalTypeEnum byCode(String code) {
        for (JournalTypeEnum e: JournalTypeEnum.values()) {
            if (e.code.equalsIgnoreCase(code)) {
                return e;
            }
        }
        return null;
    }
}
